﻿@model PagedList<RBS.Core.Model.U_Collect_Hotel>
@using Webdiyer.WebControls.Mvc
@{
    ViewBag.Title = "酒店收藏";
    Layout = "~/Views/Shared/_UserLayout.cshtml"; 
}
<script>
    $(function () {
        $("#btnDelete").click(function () {
            var f_str = "";
            $(".ltable :checkbox[id='chkId']").each(function () {
                if (this.checked && this.value != "undefined") {
                    f_str += this.value + ',';
                }
            });
            $.dialog.confirm("删除记录后不可恢复，您确定吗？", function () {
                var url = '@Url.Action("CollectHotelDelete")?ids=' + f_str;
                $.ajax({
                    url: url,
                    type: "post",
                    dataType: 'json',
                    success: function (data) {
                        if (data.IsSuccess) {
                         /*   $.dialog.alert(data.Msg);*/
                            loadPage(data.Data);
                        }
                        else {
                            //  $("#msgtip").text(data.Msg);
                            $.dialog.alert(data.Msg);
                        }
                    }
                });
            });
            return false;
        }); 
    });

    function Unsubscribe(id) {  
        var url = '@Url.Action("CollectHotelDelete")?ids=' + id;
        $.ajax({
            url: url,
            type: "post",
            dataType: 'json',
            success: function (data) {
                if (data.IsSuccess) {
                    $.dialog.alert(data.Msg);
                      loadPage(data.Data); 
                }
                else { 
                    $.dialog.alert(data.Msg);
                }
            }
        });
    }
</script>


<!--导航栏-->
@{
    @Html.Partial("_Location");
}
  <div class="tbllist">
<!--列表-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
    <tr> 
        <th>序号</th>
        <th align="left">餐厅名称</th>
        <th align="left">点评</th> 
        <th  >操作</th>
    </tr>
    @if (null != ViewData.Model)
    {
        var i = 0;
        foreach (var item in ViewData.Model)
        {
            i++;
        <tr>
            <td align="center">@i</td>
            <td align="left">
                @{
                   var hotelname = new RBS.Core.BLL.Hotel.H_Hotels().GetModelByCache(item.HotelId).H_Name;
                   // @hotelname 
                      @Html.ActionLink(@hotelname,"Order","Store",new{area="",hotelid=item.HotelId},null)
                }
            </td>
            <td align="left">
                @{
                    var CommentCount = new RBS.Core.BLL.U_Comment().GetHotelCommentCount(item.HotelId);
                    @CommentCount
                }
                条   
            </td>
             <td align="center"> 
                <a href="#" onclick="Unsubscribe(@item.Id)">取消收藏</a>
            </td> 
        </tr>
        }
    }
</table></div>
<!--/列表-->
<!--内容底部-->
<div class="line20">
</div>
<div class="pagelist">
    <div class="l-btns">
        <span>显示</span> <span>10 条/页</span><span>共 @Model.TotalPageCount 页 @Model.TotalItemCount 条记录，当前为第 @Model.CurrentPageIndex 页</span>
    </div>
    @Html.Pager(Model, new PagerOptions { PageIndexParameterName = "id", ShowPageIndexBox = true, PageIndexBoxType = PageIndexBoxType.DropDownList, ShowGoButton = false, CurrentPagerItemWrapperFormatString = "<span class=\"current\">{0}</span>" }, new { id = "PageContent", @class = "default" })
    @section Scripts{@{Html.RegisterMvcPagerScriptResource();}}
</div>
<!--/内容底部-->


